<?php
namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Service\DataReturnService as DRS;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Session;
use App\Common\Base;
use App\Service\CartService;
use Illuminate\Http\File;

/**
 * 图片上传类
 */
class UploadController extends Controller
{
    /**
     * 2018-7-31
     * 刘家腾
     * 单图片上传
     * @param      \Illuminate\Http\Request  $R      { parameter_description }
     *
     * @return     <type>                    ( description_of_the_return_value )
     */
    public function upload_picture(Request $R) 
    {
        $path = $R->file('images')->store('upload');
        $data['code'] = 666;
        $data['data'] = '/opt/www/miniapp/storage/app/'.$path;
        $data['msg'] = '上传成功！';
        return $data;
    }
    
}